feat(core): implement type testing infrastructure#255
Merged
Conversation
Add @deessejs/type-testing for compile-time type verification. Changes: - Install @deessejs/type-testing as dev dependency - Create type test files for Result, Maybe, Error, AsyncResult, and Try types - Add vitest typecheck configuration in vitest.config.ts - Create tsconfig.types.json for type test compilation - Improve swap() function documentation explaining type limitations - Reorganize tests into unit/ and types/ subdirectories Type tests verify: - Result<T, E> = Ok<T, E> | Err<E> union type - Success<T> = Result<T, never> alias - Maybe<T> = Some<T> | None union type - ExtractResultError and ExtractError conditional types - Error<T> intersection type structure - AsyncResult Thenable interface - Try<T, E> union type Co-Authored-By: martyy-code <nesalia.inc@gmail.com>
Apply recommendations from test quality report: 1. Add unit.test.ts with 12 tests for Unit singleton - Test isUnit() with singleton - Test isUnit() with various types (null, undefined, numbers, strings, etc.) - Test cross-realm Unit detection with same Symbol.for key - Test that objects without UNIT_BRAND return false 2. Add istanbul ignore comments to retry.ts unreachable throws - Lines 144-145 and 202-203 - These are TypeScript exhaustive checks, unreachable at runtime Co-Authored-By: martyy-code <nesalia.inc@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement type testing infrastructure for
@deessejs/coreusing@deessejs/type-testing.Changes
@deessejs/type-testingas dev dependencytsconfig.types.jsonfor type test compilationswap()function documentation explaining type limitationsunit.test.tswith 12 tests for Unit singletonunit/andtypes/subdirectories*.test-d.tsfilesType Tests Created
result.types.test-d.tsmaybe.types.test-d.tserror.types.test-d.tsasync-result.types.test-d.tstry.types.test-d.tsTest Results
Test plan